#ifndef HASHSET_H
#define HASHSET_H

#define NHASH 10/*number of rows in hash table*/
typedef struct Name Name;
typedef struct NameList NameList;
typedef struct predicate predicate;
struct Name
{
    char *name;
    int flag;/*0 if the sort name built-in*/
};

struct NameList
{
    Name* L;
    int arity;
};

struct predicate
{
   char *name;             /* the name of the predicate*/
   predicate *next;        /* pointer to the next predicate which has name                                                         with the same hash*/
   NameList *sortNames;      /* list of the sorts the predicate accepts*/
};



/*functions:*/
unsigned hash(char *s);          /*returns integer hash value of the given string*/
int addPredicate(char* name,NameList *sortNames);/* add new predicate declaration to the hash table*/
NameList* getSortListByName(char *name); /* returns list of sorts acceptable for the predicate with the given name*/
void deleteList(NameList *snl);  /*frees memory allocated for snl*/
void deleteHashTable();           /* frees memory allocated for the hash table*/

#endif // HASHSET_H
